/*加减号切换*/

/*加减号切换*/

/*城市名字*/
	var arr=[
			[{'id':'0','name':'燕郊'},{'shun':'1天','shou':'12','xu':'1'},{'san':'1天','shou':'8','xu':'2'},{'you':'1天','shou':'7','xu':'2'}],
			[{'id':'1','name':'北京'},{'shun':'1天','shou':'14','xu':'2'},{'san':'1天','shou':'9','xu':'3'},{'you':'1天','shou':'8','xu':'3'}],
			[{'id':'2','name':'上海'},{'shun':'2天','shou':'18','xu':'5'},{'san':'2天','shou':'12','xu':'6'},{'you':'3天','shou':'10','xu':'4'}],
			[{'id':'3','name':'天津'},{'shun':'1天','shou':'15','xu':'3'},{'san':'2天','shou':'10','xu':'3'},{'you':'2天','shou':'8','xu':'3'}],
			[{'id':'4','name':'重庆'},{'shun':'2天','shou':'18','xu':'6'},{'san':'3天','shou':'15','xu':'7'},{'you':'4天','shou':'11','xu':'5'}],
			[{'id':'5','name':'河北'},{'shun':'2天','shou':'14','xu':'2'},{'san':'2天','shou':'11','xu':'3'},{'you':'2天','shou':'8','xu':'3'}],
			[{'id':'6','name':'吉林'},{'shun':'2天','shou':'18','xu':'5'},{'san':'3天','shou':'13','xu':'6'},{'you':'3天','shou':'11','xu':'5'}],
			[{'id':'7','name':'黑龙江'},{'shun':'2天','shou':'18','xu':'5'},{'san':'3天','shou':'13','xu':'6'},{'you':'3天','shou':'11','xu':'5'}],
			[{'id':'8','name':'内蒙古'},{'shun':'2天','shou':'12','xu':'5'},{'san':'2天','shou':'12','xu':'6'},{'you':'3天','shou':'12','xu':'6'}],
			[{'id':'9','name':'安徽'},{'shun':'2天','shou':'18','xu':'5'},{'san':'2天','shou':'12','xu':'6'},{'you':'3天','shou':'10','xu':'4'}],
			[{'id':'10','name':'江苏'},{'shun':'2天','shou':'18','xu':'5'},{'san':'2天','shou':'12','xu':'6'},{'you':'3天','shou':'10','xu':'4'}],
			[{'id':'11','name':'浙江'},{'shun':'2天','shou':'18','xu':'5'},{'san':'2天','shou':'12','xu':'6'},{'you':'3天','shou':'10','xu':'4'}],
			[{'id':'12','name':'辽宁'},{'shun':'2天','shou':'18','xu':'5'},{'san':'2天','shou':'12','xu':'6'},{'you':'2天','shou':'11','xu':'5'}],
			[{'id':'13','name':'山西'},{'shun':'2天','shou':'18','xu':'5'},{'san':'2天','shou':'12','xu':'6'},{'you':'2天','shou':'11','xu':'5'}],
			[{'id':'14','name':'山东'},{'shun':'2天','shou':'18','xu':'5'},{'san':'2天','shou':'12','xu':'6'},{'you':'3天','shou':'10','xu':'4'}],
			[{'id':'15','name':'河南'},{'shun':'2天','shou':'18','xu':'5'},{'san':'2天','shou':'12','xu':'6'},{'you':'3天','shou':'10','xu':'4'}],
			[{'id':'16','name':'湖北'},{'shun':'2天','shou':'18','xu':'5'},{'san':'2天','shou':'12','xu':'6'},{'you':'3天','shou':'10','xu':'4'}],
			[{'id':'17','name':'湖南'},{'shun':'2天','shou':'18','xu':'5'},{'san':'3天','shou':'12','xu':'6'},{'you':'3天','shou':'10','xu':'4'}],
			[{'id':'18','name':'江西'},{'shun':'2天','shou':'18','xu':'5'},{'san':'3天','shou':'13','xu':'6'},{'you':'3天','shou':'11','xu':'5'}],
			[{'id':'19','name':'广东'},{'shun':'2天','shou':'18','xu':'7'},{'san':'3天','shou':'12','xu':'6'},{'you':'3天','shou':'11','xu':'5'}],
			[{'id':'20','name':'陕西'},{'shun':'2天','shou':'18','xu':'5'},{'san':'2天','shou':'13','xu':'6'},{'you':'3天','shou':'11','xu':'5'}],
			[{'id':'21','name':'四川'},{'shun':'2天','shou':'18','xu':'6'},{'san':'3天','shou':'15','xu':'7'},{'you':'3天','shou':'11','xu':'5'}],
			[{'id':'22','name':'福建'},{'shun':'2天','shou':'18','xu':'5'},{'san':'3天','shou':'13','xu':'6'},{'you':'3天','shou':'11','xu':'5'}],
			[{'id':'23','name':'广西'},{'shun':'2天','shou':'18','xu':'7'},{'san':'3天','shou':'15','xu':'7'},{'you':'5天','shou':'12','xu':'6'}],
			[{'id':'24','name':'云南'},{'shun':'2天','shou':'18','xu':'7'},{'san':'3天','shou':'15','xu':'7'},{'you':'5天','shou':'12','xu':'6'}],
			[{'id':'25','name':'贵州'},{'shun':'2天','shou':'18','xu':'6'},{'san':'3天','shou':'15','xu':'7'},{'you':'3天','shou':'12','xu':'6'}],
			[{'id':'26','name':'海南'},{'shun':'2天','shou':'18','xu':'7'},{'san':'5天','shou':'15','xu':'7'},{'you':'5天','shou':'12','xu':'6'}],
			[{'id':'27','name':'甘肃'},{'shun':'2天','shou':'18','xu':'5'},{'san':'3天','shou':'15','xu':'7'},{'you':'4天','shou':'12','xu':'6'}],
			[{'id':'28','name':'青海'},{'shun':'2天','shou':'18','xu':'5'},{'san':'4天','shou':'15','xu':'7'},{'you':'4天','shou':'12','xu':'6'}],
			[{'id':'29','name':'宁夏'},{'shun':'2天','shou':'18','xu':'5'},{'san':'3天','shou':'15','xu':'7'},{'you':'3天','shou':'12','xu':'6'}],
			[{'id':'30','name':'新疆'},{'shun':'3天','shou':'20','xu':'10'},{'san':'4天','shou':'20','xu':'10'},{'you':'6天','shou':'20','xu':'10'}],
			[{'id':'31','name':'西藏'},{'shun':'3天','shou':'26','xu':'21'},{'san':'5天','shou':'22','xu':'18'},{'you':'7天','shou':'20','xu':'15'}],
			[{'id':'32','name':'香港'},{'shun':'4天','shou':'24','xu':'11'},{'san':'1天','shou':'不发','xu':'不发'},{'you':'1天','shou':'不发','xu':'不发'}],
			[{'id':'33','name':'澳门'},{'shun':'4天','shou':'24','xu':'11'},{'san':'1天','shou':'不发','xu':'不发'},{'you':'1天','shou':'不发','xu':'不发'}],
			[{'id':'34','name':'台湾'},{'shun':'4天','shou':'36','xu':'28'},{'san':'1天','shou':'不发','xu':'不发'},{'you':'1天','shou':'不发','xu':'不发'}]
		];
/*城市名字*/
/*加减号切换*/
$('.jian').click(function(){
    custom_num=1;
    $('.zhongliang span').css('color','#14a5fb');
    $(".xieyi").attr("src","<?php echo IMG_PATH ?>bdkd/img/协议1@2x.png");
    $(this).attr("src","<?php echo IMG_PATH ?>bdkd/img/减@2x.png");
    $(".jia").attr("src","<?php echo IMG_PATH ?>bdkd/img/加1@2x.png");
    var num1 = Number($('.zhongliang span a').html()).toFixed(1);
    console.log(num1);
    var num2=(num1-1).toFixed(1);
    if(num2<=0){
        num2=0.0;
    }
    $('.zhongliang span a').html(num2);
});

$('.jia').click(function(){
    custom_num=1;
    $('.zhongliang span').css('color','#14a5fb');
    $(".xieyi").attr("src","<?php echo IMG_PATH ?>bdkd/img/协议1@2x.png");
    $(this).attr("src","<?php echo IMG_PATH ?>bdkd/img/加@2x.png");
    $(".jian").attr("src","<?php echo IMG_PATH ?>bdkd/img/减1@2x.png");
    var num1 = parseFloat($('.zhongliang span a').html());
    var num2=(num1+1).toFixed(1);
    $('.zhongliang span a').html(num2);
});
/*加减号切换*/
$('.beijing').click(function(){
	$('.shoujiandiqu ul').css('display','block');
})
$('.shoujiandiqu ul li').click(function(){
	$('.shoujiandiqu ul').css('display','none');
})
$('.shoujiandiqu ul li').each(function(index,item){
	// console.log(item);
	// console.log(index);
	$(item).click(function(){
		// console.log(typeof index);
		var csmz = arr[index][0].name;
		$('.beijing').html(csmz);
		$(".shoujiandiqu ul li").removeClass("custom_bg");
        $(this).addClass("custom_bg");
		var s_shouzhong = Number(arr[index][1].shou);
		var d_shouzhong = Number(arr[index][2].shou);
		var y_shouzhong = Number(arr[index][3].shou);

		var s_xuzhong = Number(arr[index][1].xu);
		var d_xuzhong = Number(arr[index][2].xu);
		var y_xuzhong = Number(arr[index][3].xu);

		$('.sf-jiaqian span:first a').html(s_shouzhong);
		$('.styd-jiaqian span:first a').html(d_shouzhong);
		$('.yskd-jiaqian span:first a').html(y_shouzhong);
		$('.sf-jiaqian span').eq(1).children().html(s_xuzhong);
		$('.styd-jiaqian span').eq(1).children().html(d_xuzhong);
		$('.yskd-jiaqian span').eq(1).children().html(y_xuzhong);
		var heavy = Number($('.zhongliang span a').html());

		if( heavy>1){
			var jiaqian = ((heavy-1)*s_xuzhong+s_shouzhong).toFixed(0);
			var d_jiaqian = ((heavy-1)*d_xuzhong+d_shouzhong).toFixed(0);
			var y_jiaqian = ((heavy-1)*y_xuzhong+y_shouzhong).toFixed(0);
			$('.sf-jiaqian span').eq(2).children().html(jiaqian).css('color','#ff6364');
			$('.styd-jiaqian span').eq(2).children().html(d_jiaqian).css('color','#ff6364');
			$('.yskd-jiaqian span').eq(2).children().html(y_jiaqian).css('color','#ff6364');
		}else{
			$('.sf-jiaqian span').eq(2).children().html(s_shouzhong).css('color','#ff6364');
			$('.styd-jiaqian span').eq(2).children().html(d_shouzhong).css('color','#ff6364');
			$('.yskd-jiaqian span').eq(2).children().html(y_shouzhong).css('color','#ff6364');
		}
	})
})
